#!/usr/bin/env bash

port=8080
server="tomcat"



sizecmd="curl -s http://www.luohao.work/size?port=$port\&server=$server"
res=`eval $sizecmd`



while [[  $res -gt 0 ]]
do
    echo "**** ask for $res ****"
    ipcmd="curl -s http://www.luohao.work/subscribe?port=$port\&server=$server"
    ip=`eval $ipcmd`
    echo $ip
    inscmd="sudo sh ../ins/fire_tomcat.sh $ip $port "
    eval $inscmd
    res=`eval $sizecmd`
done

echo "**** done ****"









